package com.lx.yygh.hosp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lx.yygh.common.util.MD5;
import com.lx.yygh.hosp.mapper.HospitalSetMapper;
import com.lx.yygh.hosp.service.HospitalSetService;
import com.lx.yygh.model.hosp.HospitalSet;
import com.lx.yygh.vo.order.SignInfoVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Calendar;
import java.util.Date;
import java.util.Random;

/**
 * @author c先生
 * @date 2022年10月09日 下午 2:44:43
 * @describe
 */
@Service
public class HospitalSetServiceImpl extends ServiceImpl<HospitalSetMapper, HospitalSet> implements HospitalSetService {

    @Resource
    HospitalSetMapper hospitalSetMapper;

    @Override
    public String getSignKey(String hoscode) {
        String signKey = hospitalSetMapper.getSignKey(hoscode);
        return signKey;
    }

    @Override
    public SignInfoVo getSignInfoVo(String hoscode) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("hoscode",hoscode);
        HospitalSet hospitalSet = hospitalSetMapper.selectOne(wrapper);
        SignInfoVo signInfoVo = new SignInfoVo();
        signInfoVo.setSignKey(hospitalSet.getSignKey());
        signInfoVo.setApiUrl(hospitalSet.getApiUrl());
        return signInfoVo;
    }
}
